<!DOCTYPE html>
<html lang='en'>

<head>
  <meta charset='UTF-8'>
  <meta name='viewport' content='width=device-width, initial-scale=1.0'>
  <title></title>
  <script type='text/javascript' src='js/vue.js'></script>
  <script src="js/jquery.js"></script>
</head>

<body>
  <div id='app'>
    <button @click="getJson">获取数据</button>
    <ul>
      <li v-for="item in msg">{{ item.title }}</li>
    </ul>
  </div>
  <script type='text/javascript'>
    var vm = new Vue({
      el: '#app',
      data: {
        msg: [{
          title: 123
        }]
      },
      methods: {
        getJson() {
          fetch('/douban.json').then((resolve, reject)=>{
            return resolve.json()
          }).then((data)=>{
            this.msg = data.subjects
          })
        }
      },
      mounted() {
        // getJson();
      },
    });
  </script>
  
</body>

</html>